www.gusucode.com > XerCMS 携云PHP企业建站程序 v2015PHP源码程序 > XerCMS 携云PHP企业建站程序 v2015/XerCMS_v20150724/XerCMS_v20150724/Assets/uekit/kits/emotion.js
/* * Name: User Experience Toolkit(UEKit) * Ver: 1.0.0 * Author: Arno * QQ: 1328013 * Link: http://www.uekit.com */ function emotion(id,name,container) { var el = $('#' + id); var div = $.el('div');div.className = 'emotion'; div.style.position = 'absolute';div.style.display = 'none'; div.style.top = (el.pos().top - 135) +'px'; div.style.left = el.pos().left + 'px'; div.style.padding = '5px'; div.style.border = '1px solid #ddd'; div.style.borderRadius = '5px'; div.style.width = '250px'; div.style.height = '125px'; var img = null; for(var i = 1;i <= 50;i++) { img = $.el('img'); img.src = $.path + 'assets/emotion/' + name + '/' + i + '.gif'; img.onerror = function(){this.style.display = 'none';} img.bind('click',function(){$('#' + container).innerHTML += '<img src="' + this.src + '"/>';this.parentNode.style.display = 'none';}) div.child(img); } el.bind('click',function(){div.show();}); $.child(div); }